package com.itdct.cozecd

import com.itdct.cozecd.CozeChat
import com.itdct.cozecd.bo.AdditionalMessage
import com.itdct.cozecd.bo.ChatBo

/**
 * @author Zhouwx
 * @date 2025/7/18 15:42:01
 * @version 1.0
 * @description
 */
fun main() {
    var finish = false
    val cozeChat = CozeChat("你的令牌")
    val chatBo = ChatBo()
    chatBo.botId = "你的bot_id"
    chatBo.userId = "你的用户id（必填，随便填）"
    chatBo.conversationId = "上一次回话id（选填）"
    val additionalMessage = AdditionalMessage()
    additionalMessage.content = "你的聊天数据"
    chatBo.additionalMessages.add(additionalMessage)
    cozeChat.chat(chatBo, {
        it.messageList?.let {
            val get = it.get(0)
            get.content?.also {
                println(it)
            }
        }
        finish = true
    }, {
        it.printStackTrace()
        finish = true
    })
    while (!finish) {
        Thread.sleep(1000)
    }
    println("finished")
}
